<template>
  <div class="container">
    <!-- <el-page-header @back="goBack" content="预定详情"> </el-page-header> -->
    <div class="title">会 议 室</div>
    <div class="context">{{form.会议室名称}}</div>
    <div class="title">会议时间</div>
    <div class="context">{{ form.预订日期 + ' ' + form.开始时间 + '至' + form.结束时间 }}</div>
    <div class="title">预订状态</div>
    <div class="context">
      {{form.预订状态}}
    </div>
    <div class="title">服务要求</div>
    <div class="context">{{form.服务需求}}</div>
    <!-- <div class="context">
      <el-input
        type="textarea"
        :rows="5"
        placeholder=""
        v-model="form.服务需求"
        disabled
      >
      </el-input>
    </div> -->
    <div class="title">反馈信息</div>
    <div class="context">{{form.反馈信息}}</div>
    <!-- <div class="context">
      <el-input
        type="textarea"
        :rows="5"
        placeholder=""
        v-model="form.反馈信息"
        disabled
      >
      </el-input>
    </div> -->
    <div>
      <el-result :icon="formResult.icon" :title="formResult.title"> </el-result>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      VID: '',
      ID: '',
      formResult: {
        icon: 'warning',
      },
      form: {
      }
    }
  },
  beforeRouteEnter (to, from, next) {
    // console.log(to)
    // if (from.name === "ConferenceRoomDateTime") {
    //   next((vm) => {
    //     // vm.aaa = from.params.date
    //     vm.form.date = from.params.date
    //     vm.form.startTime = from.params.startTime
    //     vm.form.endTime = from.params.endTime
    //     vm.form.dateTimeStr = from.params.date + ' ' + from.params.startTime + '至' + from.params.endTime
    //   })
    // } 
    if (from.name === "MyReservationList") {
      next((vm) => {
        vm.ID = from.params.ID
        vm.VID = from.params.VID
        vm.getMeetingOrderInfoOfMyDetail()
      })
    } 
    else {
      next()
    }
  },
  methods: {
    async getMeetingOrderInfoOfMyDetail () {
      var url = 'ConferenceRoom/GetMeetingOrderInfoOfMyDetail?ID=' + this.ID + '&VID=' + this.VID
      const { data } = await this.$Http.get(url)
      this.form = data[0]
      switch (data[0].预订状态) {
          case '预订中':{
            this.formResult.icon = 'warning'
            this.formResult.title = '等待审核中...'}
            break;
          case '预订成功':{
            this.formResult.icon = 'success'
            this.formResult.title = '审核成功'}
            break;
          default:{
            this.formResult.icon = 'error'
            this.formResult.title = '审核失败'}
            break;
        }
    },
    onSubmit () {
    },
    goBack () {
      history.back()
    },
  }
}
</script>

<style lang="scss" scoped>
.title {
  padding: 20px 50px;
  font-size: 30px;
}
.context {
  padding: 20px 50px;
  font-size: 25px;
  color: #696969;
}
.submitButtom {
  position: fixed;
  bottom: 50px;
  width: 100%;
  height: 8%;
}
.el-page-header {
  line-height: 100px;
  height: 100px;
  background-color: #409eff;
  margin-bottom: 30px;
  color: white;
}
</style>
